package com.fu.jdbc03;

import com.mchange.v2.c3p0.ComboPooledDataSource;

import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;

/**
 * @author 付大大
 * @description
 * @create 2021-01-31 15:15
 */
public class C3P0Test2 {

    public static void main(String[] args) throws SQLException {
        DataSource dataSource = new ComboPooledDataSource();

        for (int i = 0; i < 10; i++) {
            Connection connection = dataSource.getConnection();
            System.out.println(i + ":" + connection);
            if (i == 5) {
                connection.close();
            }
        }

    }
}
